www.gusucode.com > 良精ASP微博管理系统 V1.0 > 良精ASP微博管理系统 V1.0\code\admin\member_manage.asp

    <!--#include file="../Include/CheckLogin.asp"-->
<!--#include file="../Include/liangconn.asp"-->
<!--#include file="../Include/Function.asp"-->
<%
	sub showpage(sfilename,totalnumber,maxperpage,ShowTotal,ShowAllPages,strUnit)
		dim n, i,strTemp,strUrl
		if totalnumber mod maxperpage=0 then
			n= totalnumber \ maxperpage
		else
			n= totalnumber \ maxperpage+1
		end if
		strTemp= "<table align='center' class='font_3'><tr><td>"
		if ShowTotal=true then 
			strTemp=strTemp & "共 <b>" & totalnumber & "</b> " & strUnit & "&nbsp;&nbsp;"
		end if
		strUrl=JoinChar(sfilename)
		if CurrentPage<2 then
				strTemp=strTemp & "首页 上一页&nbsp;"
		else
				strTemp=strTemp & "<a href='" & strUrl & "page=1'>首页</a>&nbsp;"
				strTemp=strTemp & "<a href='" & strUrl & "page=" & (CurrentPage-1) & "'>上一页</a>&nbsp;"
		end if
	
		if n-currentpage<1 then
				strTemp=strTemp & "下一页 尾页"
		else
				strTemp=strTemp & "<a href='" & strUrl & "page=" & (CurrentPage+1) & "'>下一页</a>&nbsp;"
				strTemp=strTemp & "<a href='" & strUrl & "page=" & n & "'>尾页</a>"
		end if
		strTemp=strTemp & "&nbsp;页次:<strong><font color=red>" & CurrentPage & "</font>/" & n & "</strong>页 "
		strTemp=strTemp & "&nbsp;<b>" & maxperpage & "</b>" & strUnit & "/页"
		if ShowAllPages=True then
			strTemp=strTemp & "&nbsp;转到:<select class='input' name='page' size='1' onchange=""javascript:window.location='" & strUrl & "page=" & "'+this.options[this.selectedIndex].value;"">"   
			for i = 1 to n   
				strTemp=strTemp & "<option value='" & i & "'"
				if cint(CurrentPage)=cint(i) then strTemp=strTemp & " selected "
				strTemp=strTemp & ">第" & i & "页</option>"   
			next
			strTemp=strTemp & "</select>"
		end if
	
		strTemp=strTemp & "</td></tr></table>"
		response.write strTemp
	end sub
	
	function JoinChar(strUrl)	'分页附属函数
		if strUrl="" then
			JoinChar=""
			exit function
		end if
		if InStr(strUrl,"?")<len(strUrl) then 
			if InStr(strUrl,"?")>1 then
				if InStr(strUrl,"&")<len(strUrl) then 
					JoinChar=strUrl & "&"
				else
					JoinChar=strUrl
				end if
			else
				JoinChar=strUrl & "?"
			end if
		else
			JoinChar=strUrl
		end if
	end function 

	action 	= request("action")
	act 	= request("act")
	User_ID  	= request("User_ID")
	
	dim action,id
	dim totalpage,maxperpage,totalrecords,i,currentpage
	
	response.expires = 0
	currentpage = request("page")
	if currentpage = "" then
		currentpage=1
	end if
			
	maxperpage 		= 25
	totalrecords	= 0
	totalpage		= 1
		
	Set Rs = Server.CreateObject("ADODB.Recordset")
	
	if action = "del" then
		Sql = "Delete From Liangjing_User Where User_ID="&User_ID
		Conn.execute(Sql)
		Response.Redirect("Member_Manage.asp?page="&Request("page"))
		Response.end
	elseif action = "lock" then
		Sql = "Update Liangjing_User Set User_IsLock="&Request("Lock_Type")&" Where User_ID="&User_ID
		Conn.execute(Sql)
		Response.Redirect("Member_Manage.asp?page="&Request("page"))
		Response.end
	elseif action = "IsSupper" then
		Sql = "Update Liangjing_User Set User_IsSupper="&Request("Supper_Type")&" Where User_ID="&User_ID
		Conn.execute(Sql)
		Response.Redirect("Member_Manage.asp?page="&Request("page"))
		Response.end	
	end if
%>

<script language="javascript">
<!--
	function frUser_onsubmit(frm){
		var frm = eval(frm);
		if(frm.admin_loginname.value==""){
			alert("登陆名不能为空!");
			frm.admin_loginname.focus();
			return false;
		}
		if(frm.admin_name.value==""){
			alert("管理员的真实姓名不能为空!");
			frm.admin_name.focus();
			return false;
		}
		if(frm.admin_pass.value != ""){
			if(frm.admin_pass.value != frm.admin_pass2.value){
				alert("两次密码不一至!");
				frm.admin_pass.focus();
				return false;
			}
		}
		if(frm.action.value == "add"){
			if(frm.admin_pass.value == ""){
				alert("密码不能为空!");
				frm.admin_pass.focus();
				return false;
			}
			if(frm.admin_pass.value != frm.admin_pass2.value){
				alert("两次密码不一至!");
				frm.admin_pass.focus();
				return false;
			}
		}
		if(confirm("您确定要操作此管理员吗?")){
			return true;
		}
		return false;
	}
	
	function isDel(id){
		if(confirm("您确定要删除此账号吗?")){
			location.href="Member_Manage.asp?Action=del&User_ID="+id+"&page="+<%=currentpage%>;
		}
	}
	
	function OpenOrCloseLock(id,type){
		var alertStr;
		if(type==1){
			alertStr = "确定要将此账号上锁吗?";
		}else{
			alertStr = "确定要将此账号解锁吗?";
		}
		if(confirm(alertStr)){
			location.href="Member_Manage.asp?action=lock&Lock_Type="+type+"&User_ID="+id+"&page="+<%=currentpage%>;
		}
	}
	
	function IsAdmin(id,type){
		var alertStr;
		if(type==1){
			alertStr = "确定要将此用户变为前台管理员吗?";
		}else{
			alertStr = "确定要将此用户的前台管理员权限关闭吗?";
		}
		if(confirm(alertStr)){
			location.href="Member_Manage.asp?action=IsSupper&Supper_Type="+type+"&User_ID="+id+"&page="+<%=currentpage%>;
		}
	}
-->
</script>
<link href="images/Admin.css" rel="stylesheet" type="text/css">
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
      <td>			  
			<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
			  <tr bgcolor="#EAEAEA"> 
			  	<td height="25" align="center">编号</td>
				<td align="center">用户名</td>
				<td align="center">邮箱地址</td>
				<td align="center">发布信息</td>
				<td align="center">管理员</td>
				<td align="center">注册日期</td>
				<td align="center">操作</td>
			  </tr>
			  <%			    	
			  	Set Rs = Server.CreateObject("Adodb.recordset")
				sql="SELECT *,(Select count(Src_ID) From Liangjing_Source where Src_Userid=User_ID) as Src_Count From Liangjing_User order by User_IsSupper,User_ID Desc"
				Rs.open Sql,conn,1,2
				if Not Rs.eof then
					rs.pagesize		= maxperpage
					rs.absolutepage	= currentpage
					totalpage		= rs.pagecount
					totalrecords	= rs.recordcount
				end if
			  	j = 0  
			  	While not rs.eof and j < maxperpage
					j = j + 1
			  %>
			  <tr<%= Tr_MouseOver %> bgcolor="#FFFFFF"> 
			  	<td height="22" align="center">&nbsp;<%=Rs("User_ID")%></td>
				<td align="left">&nbsp;&nbsp;<%=Rs("User_CoolName")%></td>
				<td align="Left">&nbsp;<a href="mailto:<%=Rs("User_Email")%>"><%=Rs("User_Email")%></a></td>
				<td align="center">&nbsp;<%=Rs("Src_Count")%> 条</td>
				<td align="center">&nbsp;<% if Rs("User_IsSupper")=true then Response.Write("<font color='#ff0000'>是</font>") else Response.Write("否")%></td>
				<td align="center">&nbsp;<%=Rs("User_SignInDate")%></td>
				<td align="center"> 					
					<%						
						if Rs("User_IsSupper") = true then							
							Response.write("<a href='javascript:IsAdmin("&Rs("User_ID")&",0);' title='点击改变成普通用户'><font color='#ff0000'>前台管理员</font></a>")
						else
							Response.write("<a href='javascript:IsAdmin("&Rs("User_ID")&",1);' title='点击改变成前台管理员'>普通用户</a>")
						end if
						Response.Write(" | ")
						if Rs("User_IsLock") = true then
							Response.write("<a href='javascript:OpenOrCloseLock("&Rs("User_ID")&",0);' title='点击解锁用户'><font color='#ff0000'>解锁</font></a>")
						else
							Response.write("<a href='javascript:OpenOrCloseLock("&Rs("User_ID")&",1);' title='点击上锁用户'>上锁</a>")
						end if
						Response.Write(" | ")
						Response.write("<a href='javascript:isDel("&Rs("User_ID")&");'>删除</a>&nbsp;")
						Response.Write(" | ")
						Response.write("<a href='Member_ShowInfo.asp?User_ID="&Rs("User_ID")&"'>查看</a>&nbsp;")
					%> 					
				</td>
			  </tr>
			  <%
					Rs.MoveNext 
				Wend
			  %>
			</table>
			
			<br>			
		
			<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
				<tr> 
					<td width="100%" height="23" bgcolor="#EAEAEA" align="right">	
                      <% Call showpage("Member_Manage.asp",totalrecords,maxperpage,true,true,"位会员") %>
					</td>
				</tr>
			</table>
		
	</td>	
	</tr>
	<tr> 
	  <td height="22"></td>
	</tr>
</table>

<%  
Set Rs = Nothing 
Set Conn = Nothing 
%>